package com.wly.ui.panel
{
	import com.wly.datapool.define.GlobalDefine;
	import com.wly.datapool.global.GlobalInfo;
	
	import flash.display.MovieClip;
	import flash.text.TextField;
	
	public class GlobalInfoPanel extends MovieClip
	{
		private var _tfMoney:TextField;
		private var _tfSP:TextField;
		
		static private var _instance:GlobalInfoPanel;
		
		public function GlobalInfoPanel()
		{
			super();
			_instance = this;
			_tfMoney = getChildByName("tfMoney") as TextField;
			_tfSP    = getChildByName("tfSP") as TextField;
		}
		
		static public function getInstance():GlobalInfoPanel
		{
			return _instance;
		}
		
		public function updateData():void
		{
			_tfMoney.text = GlobalInfo.money.toString();
			_tfSP.text    = GlobalInfo.sp.toString()+"/"+GlobalDefine.STAGE_INIT_MAXSP;
		}
		
		public function upodateMoney():void
		{
			_tfMoney.text = GlobalInfo.money.toString();
		}
		
		public function updateSP():void
		{
			_tfSP.text    = GlobalInfo.sp.toString();
		}
	}
}